/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.anachronos.jeep.model.trace;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.common.util.Enumerator;

/**
 * <!-- begin-user-doc -->
 * A representation of the literals of the enumeration '<em><b>Transaction Status</b></em>',
 * and utility methods for working with them.
 * <!-- end-user-doc -->
 * @see org.anachronos.jeep.model.trace.TracePackage#getTransactionStatus()
 * @model extendedMetaData="name='transactionStatus'"
 * @generated
 */
public enum TransactionStatus implements Enumerator {
	/**
	 * The '<em><b>ROLLINGBACK</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #ROLLINGBACK_VALUE
	 * @generated
	 * @ordered
	 */
	ROLLINGBACK(0, "ROLLINGBACK", "ROLLING_BACK"),

	/**
	 * The '<em><b>COMMITING</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #COMMITING_VALUE
	 * @generated
	 * @ordered
	 */
	COMMITING(1, "COMMITING", "COMMITING"),

	/**
	 * The '<em><b>PREPARING</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #PREPARING_VALUE
	 * @generated
	 * @ordered
	 */
	PREPARING(2, "PREPARING", "PREPARING"),

	/**
	 * The '<em><b>NOTRANSACTION</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #NOTRANSACTION_VALUE
	 * @generated
	 * @ordered
	 */
	NOTRANSACTION(3, "NOTRANSACTION", "NO_TRANSACTION"),

	/**
	 * The '<em><b>UNKNOWN</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #UNKNOWN_VALUE
	 * @generated
	 * @ordered
	 */
	UNKNOWN(4, "UNKNOWN", "UNKNOWN"),

	/**
	 * The '<em><b>ROLLEDBACK</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #ROLLEDBACK_VALUE
	 * @generated
	 * @ordered
	 */
	ROLLEDBACK(5, "ROLLEDBACK", "ROLLEDBACK"),

	/**
	 * The '<em><b>COMMITED</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #COMMITED_VALUE
	 * @generated
	 * @ordered
	 */
	COMMITED(6, "COMMITED", "COMMITED"),

	/**
	 * The '<em><b>PREPARED</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #PREPARED_VALUE
	 * @generated
	 * @ordered
	 */
	PREPARED(7, "PREPARED", "PREPARED"),

	/**
	 * The '<em><b>MARKEDROLLBACK</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #MARKEDROLLBACK_VALUE
	 * @generated
	 * @ordered
	 */
	MARKEDROLLBACK(8, "MARKEDROLLBACK", "MARKED_ROLLBACK"),

	/**
	 * The '<em><b>ACTIVE</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #ACTIVE_VALUE
	 * @generated
	 * @ordered
	 */
	ACTIVE(9, "ACTIVE", "ACTIVE");

	/**
	 * The '<em><b>ROLLINGBACK</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>ROLLINGBACK</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #ROLLINGBACK
	 * @model literal="ROLLING_BACK"
	 * @generated
	 * @ordered
	 */
	public static final int ROLLINGBACK_VALUE = 0;

	/**
	 * The '<em><b>COMMITING</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>COMMITING</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #COMMITING
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int COMMITING_VALUE = 1;

	/**
	 * The '<em><b>PREPARING</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>PREPARING</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #PREPARING
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int PREPARING_VALUE = 2;

	/**
	 * The '<em><b>NOTRANSACTION</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>NOTRANSACTION</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #NOTRANSACTION
	 * @model literal="NO_TRANSACTION"
	 * @generated
	 * @ordered
	 */
	public static final int NOTRANSACTION_VALUE = 3;

	/**
	 * The '<em><b>UNKNOWN</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>UNKNOWN</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #UNKNOWN
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int UNKNOWN_VALUE = 4;

	/**
	 * The '<em><b>ROLLEDBACK</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>ROLLEDBACK</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #ROLLEDBACK
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int ROLLEDBACK_VALUE = 5;

	/**
	 * The '<em><b>COMMITED</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>COMMITED</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #COMMITED
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int COMMITED_VALUE = 6;

	/**
	 * The '<em><b>PREPARED</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>PREPARED</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #PREPARED
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int PREPARED_VALUE = 7;

	/**
	 * The '<em><b>MARKEDROLLBACK</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>MARKEDROLLBACK</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #MARKEDROLLBACK
	 * @model literal="MARKED_ROLLBACK"
	 * @generated
	 * @ordered
	 */
	public static final int MARKEDROLLBACK_VALUE = 8;

	/**
	 * The '<em><b>ACTIVE</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>ACTIVE</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #ACTIVE
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int ACTIVE_VALUE = 9;

	/**
	 * An array of all the '<em><b>Transaction Status</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static final TransactionStatus[] VALUES_ARRAY =
		new TransactionStatus[] {
			ROLLINGBACK,
			COMMITING,
			PREPARING,
			NOTRANSACTION,
			UNKNOWN,
			ROLLEDBACK,
			COMMITED,
			PREPARED,
			MARKEDROLLBACK,
			ACTIVE,
		};

	/**
	 * A public read-only list of all the '<em><b>Transaction Status</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final List<TransactionStatus> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));

	/**
	 * Returns the '<em><b>Transaction Status</b></em>' literal with the specified literal value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static TransactionStatus get(String literal) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			TransactionStatus result = VALUES_ARRAY[i];
			if (result.toString().equals(literal)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Transaction Status</b></em>' literal with the specified name.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static TransactionStatus getByName(String name) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			TransactionStatus result = VALUES_ARRAY[i];
			if (result.getName().equals(name)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Transaction Status</b></em>' literal with the specified integer value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static TransactionStatus get(int value) {
		switch (value) {
			case ROLLINGBACK_VALUE: return ROLLINGBACK;
			case COMMITING_VALUE: return COMMITING;
			case PREPARING_VALUE: return PREPARING;
			case NOTRANSACTION_VALUE: return NOTRANSACTION;
			case UNKNOWN_VALUE: return UNKNOWN;
			case ROLLEDBACK_VALUE: return ROLLEDBACK;
			case COMMITED_VALUE: return COMMITED;
			case PREPARED_VALUE: return PREPARED;
			case MARKEDROLLBACK_VALUE: return MARKEDROLLBACK;
			case ACTIVE_VALUE: return ACTIVE;
		}
		return null;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final int value;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String name;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String literal;

	/**
	 * Only this class can construct instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private TransactionStatus(int value, String name, String literal) {
		this.value = value;
		this.name = name;
		this.literal = literal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getValue() {
	  return value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
	  return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLiteral() {
	  return literal;
	}

	/**
	 * Returns the literal value of the enumerator, which is its string representation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		return literal;
	}
	
} //TransactionStatus
